package com.jic.market.common.constant;

/**
 *@className PromotionMutexEnum
 *@description 促销活动互斥枚举
 *@author xuyongliang
 *@date 2020/1/16 2:33 PM
 *@version 1.0
**/
public enum PromotionMutexEnum {

    /** 单一  单一*/
    SINGLE_SINGLE("1_1", 1),
    /** 单一  满量*/
    SINGLE_AMOUNT("1_2", 0),
    SINGLE_QUOTA("1_3", 0),
    SINGLE_GIVE("1_4", 0),
    SINGLE_CHANGE("1_5", 0),
    SINGLE_COMB("1_6", 0),
    SINGLE_XUNIT("1_7", 1),
    SINGLE_SECKILL("1_8", 1),
    SINGLE_MAIL("1_9", 0),

    AMOUNT_SINGLE("2_1", 0),
    AMOUNT_AMOUNT("2_2", 1),
    AMOUNT_QUOTA("2_3", 1),
    AMOUNT_GIVE("2_4", 0),
    AMOUNT_CHANGE("2_5", 0),
    AMOUNT_COMB("2_6", 1),
    AMOUNT_XUNIT("2_7", 1),
    AMOUNT_SECKILL("2_8", 1),
    AMOUNT_MAIL("2_9", 0),

    QUOTA_SINGLE("3_1", 0),
    QUOTA_AMOUNT("3_2", 1),
    QUOTA_QUOTA("3_3", 1),
    QUOTA_GIVE("3_4", 0),
    QUOTA_CHANGE("3_5", 0),
    QUOTA_COMB("3_6", 1),
    QUOTA_XUNIT("3_7", 1),
    QUOTA_SECKILL("3_8", 1),
    QUOTA_MAIL("3_9", 0),

    GIVE_SINGLE("4_1", 0),
    GIVE_AMOUNT("4_2", 0),
    GIVE_QUOTA("4_3", 0),
    GIVE_GIVE("4_4", 1),
    GIVE_CHANGE("4_5", 0),
    GIVE_COMB("4_6", 0),
    GIVE_XUNIT("4_7", 1),
    GIVE_SECKILL("4_8", 1),
    GIVE_MAIL("4_9", 0),


    CHANGE_SINGLE("5_1", 0),
    CHANGE_AMOUNT("5_2", 0),
    CHANGE_QUOTA("5_3", 0),
    CHANGE_GIVE("5_4", 0),
    CHANGE_CHANGE("5_5", 1),
    CHANGE_COMB("5_6", 0),
    CHANGE_XUNIT("5_7", 1),
    CHANGE_SECKILL("5_8", 1),
    CHANGE_MAIL("5_9", 0),

    COMB_SINGLE("6_1", 0),
    COMB_AMOUNT("6_2", 1),
    COMB_QUOTA("6_3", 1),
    COMB_GIVE("6_4", 1),
    COMB_CHANGE("6_5", 1),
    COMB_COMB("6_6", 1),
    COMB_XUNIT("6_7", 1),
    COMB_SECKILL("6_8", 1),
    COMB_MAIL("6_9", 0),

    XUNIT_SINGLE("7_1", 1),
    XUNIT_AMOUNT("7_2", 1),
    XUNIT_QUOTA("7_3", 1),
    XUNIT_GIVE("7_4", 1),
    XUNIT_CHANGE("7_5", 1),
    XUNIT_COMB("7_6", 1),
    XUNIT_XUNIT("7_7", 1),
    XUNIT_SECKILL("7_8", 1),
    XUNIT_MAIL("7_9", 0),

    SECKILL_SINGLE("8_1", 1),
    SECKILL_AMOUNT("8_2", 1),
    SECKILL_QUOTA("8_3", 1),
    SECKILL_GIVE("8_4", 1),
    SECKILL_CHANGE("8_5", 1),
    SECKILL_COMB("8_6", 1),
    SECKILL_XUNIT("8_7", 1),
    SECKILL_SECKILL("8_8", 1),
    SECKILL_MAIL("8_9", 0),

    MAIL_SINGLE("9_1", 0),
    MAIL_AMOUNT("9_2", 0),
    MAIL_QUOTA("9_3", 0),
    MAIL_GIVE("9_4", 0),
    MAIL_CHANGE("9_5", 0),
    MAIL_COMB("9_6", 0),
    MAIL_XUNIT("9_7", 1),
    MAIL_SECKILL("9_8", 1),
    MAIL_MAIL("9_9", 1);


    private String code;

    private Integer value;

    PromotionMutexEnum(String code, Integer value) {
        this.code = code;
        this.value = value;
    }

    public static PromotionMutexEnum getValueByCode(String code){
        PromotionMutexEnum[] ctes = PromotionMutexEnum.values();
        for(PromotionMutexEnum cte : ctes){
            if(cte.code.equals(code)){
                return cte;
            }
        }
        return null;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }
}
